from random import randint

num = int(input("Enter a number:"))
for i in range(1, num + 1):  # 0-9,一个控制上边界，一个控制下边界
    print(i, end="\t")
# 2循环和if的结合
# 打印100以内能被3整除的数字
for i in range(1, 101):
    if i % 3 == 0 or i%7 ==0:
        print(i, end="\t")
# 猜数字
# 随机数random
num = randint(1, 10)
print(num)
while True:
    guess = int(input("Enter a number:"))
    if guess == num:
        print("you are right")
        break
    elif guess > num:
        print("bigger")
    else:
        print("smaller")

for i in range(1, 101):
    if i % 7 == 0 or str(i).find("7") != 1:
        print(i, end="\t")

for i in range(1, 101):
    if i % 7 == 0 and str(i).count('7') > 0:
        print(i, end="\t")
for i in range(1, 101):
    if i % 7 == 0 or '7' in str(i)!= 1:
        print(i, end="\t")
# 打印菱形
for i in range(1,11+1,2):
    print(("*"*i).center(11))
for i in range(9,0,-2):
    print(("*"*i).center(11))
#打印水仙花树
for i in range(1,101):
    if i**3==i:
        print(i)
        break
for j in range(2, i):
    if i % j == 0:
        break
else:
    print(i)
#打印100以内的质数
for i in range(2,101):
    for j in range(2,i):
        if i % j == 0:
            break
    else:
        print(i)
#打印斐波那契数列
for i in range(1,101):
    if i % 2 == 0:
        print(i,end="\t")
        continue
        print(i,end="\t")
        break
#打印九九乘法表
for i in range(1,10):
    for j in range(1,i+1):
        print(i*j,end="\t")
    print()
#打印100以内的定数